package com.chis.dubbo;

import com.chis.dubbo.service.ITest;
import com.chis.dubbo.service.ITest2;
import com.chis.dubbo.service.TestBean;
import com.chis.jm.bean.di.mzdj.TdDiPsnBean;
import com.chis.jmdatatimer.comm.TxMgmtModule;
import com.chis.protostuff.ProtostuffSerialize;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author wlj
 * @version 2019年03月14日
 * @Description
 * @Company zwx
 */
public class Consumer {

    public static void main(String[] args) {
        try {
            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"consumer.xml"});
            ITest test = (ITest) context.getBean("test");
            Long l = System.currentTimeMillis();
            test.method();
            System.out.println("耗时1：" + (System.currentTimeMillis() - l));
//            while (true) {
//                Long l1 = System.currentTimeMillis();
//                test.method();
//                System.out.println("耗时：" + (System.currentTimeMillis() - l1));
//            }

//            ExecutorService cachedThreadPool = Executors.newFixedThreadPool(3000);
//            for (int i = 1; i <= 2000; i++) {
//
//                cachedThreadPool.execute(() -> {
//                    Long l1 = System.currentTimeMillis();
//                    test.method();
//                    System.out.println("耗时：" + (System.currentTimeMillis() - l1));
//                });
//
//            }
            System.out.println("线程：" + (System.currentTimeMillis() - l));
        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
